from course import models
from rest_framework import serializers

class Category(serializers.ModelSerializer):
    class Meta:
        model = models.CategoryModel
        fields = ["cname","id"]

class CategorySerializer(serializers.ModelSerializer):
    children=Category(many=True)
    class Meta:
        model = models.CategoryModel
        fields = '__all__'
